<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">
		<h:body>
		<br/>
			<h:form>
				<h:commandButton value="#{msg.BU_requestHistory_backButton}" actionListener="#{userPageBean.setPage('requestResources')}"
					class="button"></h:commandButton>
			</h:form>
			
			<h:outputText value="#{msg.BU_requestHistory_message}" color="#890120" rendered="#{not requestResourceBean.emptyList}"></h:outputText>
			
			<h:dataTable border="0" cellspacing="10" style="width:100%;" class="table" rendered="#{requestResourceBean.emptyList}"
				value="#{requestResourceBean.tickets}" var="rT">
				<h:column id="column1">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_curNumber}"></h:outputText>
					</f:facet>
					<h:outputText value="#{requestResourceBean.tickets.rowIndex+1}"></h:outputText>
				</h:column>
				
				<h:column id="column2">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_ticketID}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.ticketId}"></h:outputText>
				</h:column>
				
				<h:column id="column3">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_resource}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.resourceName}"></h:outputText>
				</h:column>
				
				<h:column id="column4">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_quantity}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.quantity}"></h:outputText>
				</h:column>
				
				<h:column id="column5">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_mu}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.measureunit}"></h:outputText>
				</h:column>
				
				<h:column id="column6">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_description}"></h:outputText>
					</f:facet>
					<h:form>
						<h:inputTextarea class="smallTextArea"
							value="#{rT.ticketDescription}" disabled="true"></h:inputTextarea>
					</h:form>
				</h:column>
				
				<h:column id="column7">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_status}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.status}"></h:outputText>
				</h:column>
				
				<h:column id="column8">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_date}"></h:outputText>
					</f:facet>

					<h:outputText value="#{rT.date}">
						<f:convertDateTime pattern="dd.MM.yyyy" />
					</h:outputText>
				</h:column>

				<h:column id="column9">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_responder}"></h:outputText>
					</f:facet>
					<h:outputText value="#{rT.responder}"></h:outputText>
				</h:column>

				<h:column id="column10">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_response}"></h:outputText>
					</f:facet>

					<h:form>
						<h:inputTextarea value="#{rT.responseDescription}" disabled="true"
							class="smallTextArea"></h:inputTextarea>
					</h:form>
				</h:column>
				
				<h:column id="column11">
					<f:facet name="header">
						<h:outputText value="#{msg.BU_requestHistory_table_responseDate}"></h:outputText>
					</f:facet>

					<h:outputText value="#{rT.responseDate}">
						<f:convertDateTime pattern="dd.MM.yyyy" />
					</h:outputText>
				</h:column>

			</h:dataTable>
		</h:body>
	</ui:define>
</ui:composition>
</html>